# -*- coding: utf-8 -*-
# @Author: Lemongman


# 单例装饰器
def singleton(cls, *args, **kw):
    _instance = {}

    def inner():
        if cls not in _instance:
            _instance[cls] = cls(*args, **kw)
        return _instance[cls]
    return inner
